package com.bdqn.util;

import org.apache.commons.lang3.StringUtils;
import sun.plugin.util.UIUtil;

import javax.servlet.http.HttpSession;
import java.util.UUID;

/**
 *令牌工具
 * @author jinge
 *
 */

public class TokenUtil {

    public static String encodeStr = "love";


    public static String  getToken(HttpSession session){
        String token = (String) session.getAttribute("token");
        if (StringUtils.isBlank(token) ) {
            token = UUID.randomUUID().toString().replace("-","");
        }
        return  token;
    }


}
